const express = require('express');
const app = express();

app.all('/cors-server', (request, response) => {
    // setHeader原理是CORS
    response.setHeader('Access-Control-Allow-Origin', '*');
    response.setHeader('Access-Control-Allow-Headers', '*');
    response.setHeader('Access-Control-Allow-Method', '*');
    
    response.send('CORS');
});

app.listen(7777, () => {
    console.log('(CORS)服务已启动, 在7777端口监听');
})